All Functions Used So Far, Week 7

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

range

{base}

Return range of values

summary

{base}

Obtain summary statistics or detailed regression output

coef

{stats}

Extract model coefficients

predict

{stats}

Generate predicted values from model objects

ordered

{dplyr}

Create an ordered factor

t

{base}

Transpose a matrix or data frame

length

{base}

Returns number of elements in an object

save_tt

{tinytable}

Save a tinytable object to a file

arrange

{dplyr}

Sort values of data frame according to a variable/combination of variables

glm

{base}

Fits generalized linear models

dnorm

{stats}

Density distribution for the normal distribution

install.packages

{utils}

Install R packages

cut

{base}

Convert Numeric to Factor

c

{base}

Combine values/vectors into a vector

sd

{stats}

Get standard deviation of a vector

nrow

{base}

Get number of rows of a data frame

matrix

{base}

Creates a matrix from the given set of values.

modelsummary

{modelsummary}

Creates regression and data tables

median

{stats}

Get median of a vector

factor

{base}

Create factor variables

attr

{base}

Access or modify the attributes of an object

round

{base}

Rounds numbers

log

{base}

log (default base = e)

rm

{base}

Remove objects

auc

{pRoc}

Returns the area under the curve

scale_color_manual

{ggplot2}

Manually sets the colours used in a ggplot color scale to user-specified values

tibble

{tibble}

A modern data frame from the tidyverse

sqrt

{base}

Square-root function

max

{base}

Get maximum of a vector

is.na

{base}

Check if a value is NA/elements of vector are NA

as.numeric

{base}

Coerce a vector to numeric

factor

{base}

Create a factor

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

var

{stats}

Calculate variance

data.frame

{base}

Create a data.frame from vectors

nobs

{stats}

Return the number of observations in a model object

View

{base}

View a data frame

setwd

{base}

Set Working Directory

library

{base}

Load an R package

colMeans

{base}

Computes the means of each column of a numeric matrix or data frame

names

{base}

Get or set names of an object

binomial

{base}

Family argument in glm()

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

quantile

{stats}

Obtain empirical quantiles of a vector

group_tt

{tinytable}

Grouping in tinytable

list

{base}

Create a list object

unlist

{base}

Flattens a list into a vector by extracting all its elements

coeftest

{lmtest}

Inference for Estimated Coefficients

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

sim_slopes

{interactions}

Perform simple slopes analysis for interaction effects.

plot

{graphics}

Generic function from base R to produce a plot

head

{utils}

Show first 5 rows of a data frame

lm

{stats}

Fit linear models using least squares

read_excel

{readxl}

Read an Excel file

ungroup

{dplyr}

Resolve grouping created with “group_by”

mutate

{dplyr}

Create new variables

seq

{base}

Create a sequence

expression

{base}

Used in plots to add symbols to axes

min

{base}

Get minimum of a vector

roc

{pRoc}

Create a Receiver Operating Characteristic (ROC) curve

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

filter

{dplyr}

Filter out rows of a data frame according to logical vector

ifelse

{base}

Return a or b depending on the value of test

lag

{dplyr}

Shift values in a vector or time series

diag

{base}

Extract or construct diagonal elements or matrices

mean

{base}

Get mean of a vector

order

{base}

Get indexes that will sort a vector

complete.cases

{stats}

Find Complete Cases

str

{utils}

Get the structure of an R object

The end!